package ExtendSth;

public class Grandpa {
    private String name;
    private String age;
    private String sth;

    public Grandpa() {
        System.out.println("爷爷的无参构造器");
    }

    public Grandpa(String name, String age, String sth) {
        this.name = name;
        this.age = age;
        this.sth = sth;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public String getSth() {
        return sth;
    }

    public void setSth(String sth) {
        this.sth = sth;
    }

    @Override
    public String toString() {
        return "Grandpa{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", course='" + sth + '\'' +
                '}';
    }
}
